package com.cainaer.shop.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cainaer.common.core.web.domain.AjaxResult;
import com.cainaer.common.core.web.page.TableDataInfo;
import com.cainaer.shop.config.AMapUtils;
import com.cainaer.shop.config.LngLat;
import com.cainaer.shop.domain.VegetableMarket;
import com.cainaer.shop.domain.vo.VegetableMarketVo;
import com.cainaer.shop.service.IVegetableMarketService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.cainaer.common.core.web.controller.BaseController;

import java.util.List;

/**
 * <p>
 * 菜市场表 前端控制器
 * </p>
 *
 * @author Tina
 * @since 2020-09-03
 */
@RestController
@RequestMapping("/vegetableMarket/")
public class VegetableMarketController extends BaseController  {

    private Logger logger = LoggerFactory.getLogger(VegetableMarketController.class);

    @Autowired
    private IVegetableMarketService vegetableMarketService;

    @GetMapping("get")
    public List<VegetableMarket> list(VegetableMarket vegetableMarket){
        return vegetableMarketService.list();
    }
    /**
     * 分页查询菜市场列表
     * @param vegetableMarket
     * @return
     */
    @GetMapping("list")
    //@PreAuthorize("@ss.hasPermi('mobile:shop:list')")
    public AjaxResult queryVegetableMarketInfo(VegetableMarket vegetableMarket,@RequestParam("condition") Integer condition){
        List<VegetableMarketVo> vegetableMarketVoList = vegetableMarketService.queryVegetableMarket(vegetableMarket,condition);
        
         return AjaxResult.success(vegetableMarketVoList) ;

    }

}
